﻿using IBLL;
using MODEL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Shop.Controllers
{
    public class BaseController<T,B> : Controller where T : BaseModel, new() where B : IBaseBLL<T>
    {
        public virtual B Bll { get; set; }
        //public B bll = new B();
        [HttpGet]
        public virtual ActionResult Add()
        {
            return View();
        }
        public virtual ActionResult Update()
        {
            return View();
        }
        public virtual ActionResult List()
        {

            return View();
        }
        public virtual ActionResult Del(int id)
        {

            int result = Bll.Delete(id);

            return Json(new { state = result > 0 ? true : false, msg = "删除成功" });
        }
    }
}